<?php
if(!defined('PATH')) exit();

if($check->type == 0) {
$this->archez->showMsg('Select a character to receive the item.<span style="float:right;"><a href="' . PATH . '/store/'.$this->default_action.'">cancel</a></span>', 'requirement');
echo '<br />';
}

?>
<form action="<?=PATH?>/store/confirm/" method="post">
<input type="hidden" name="itemid" value="<?=$check->id?>" />
<table border="0" cellpadding="8" cellspacing="1" width="100%">
<tr class="head"><td colspan="4"><b>Checkout</b><span style="float:right;">(item # <?=$check->id?>)</span></td></tr>
<?php
$characters = $account->getPlayersList();
$characters->orderBy('name');

if($check->type == Model_Store::TYPE_ITEM) {
$amount = 'x';
?>
<tr><td width="30%" rowspan="2">Character name:</td><td rowspan="2"><select name="character">
<?php

foreach($characters as $row)
{
	if (!$row->isDeleted()) {
?>
<option value="<?=$row->getName()?>"><?=$row->getName()?></option>
<?php
	}
}
?>
</select></td><td>or character:</td><td><input type="text" name="other" maxlength="25"</td></tr>
<tr><td>from who:</td><td><input type="text" name="from" maxlength="25"/></td></tr>
<?php
} elseif($check->type == Model_Store::TYPE_PREMMY) {
$amount = ' days';
?>
<tr><td rowspan="2">Send to:</td><td rowspan="2"><input type="radio" name="character" class="checkbox" checked="checked" /> my account</td><td>or character:</td><td><input type="text" name="other" maxlength="25"/></td></tr>
<tr><td>from who:</td><td><input type="text" name="from" maxlength="25"/></td></tr>
<?php
}
?>
<tr><td>Item:</td><td colspan="3"><?=$check->name?></td></tr>
<tr><td>Price:</td><td colspan="3"><?=$check->price . ' ' . $check->unit?></td></tr>
<tr><td>Amount:</td><td colspan="3"><?=$check->amount.$amount?></td></tr>
<tr><td colspan="4"><input type="submit" value="Buy" /></td></tr>
</table>
</form>